﻿@page "/admin/collect"
@layout ImoviesBlazorAntPro.BasicLayout
@attribute [Authorize]
@*@attribute [Authorize(Roles = "admin")]*@
@*@attribute [Authorize(Roles = "guest")]*@


<PageContainer Title="采集管理">
    <Breadcrumb>
        <Breadcrumb>
            <BreadcrumbItem>Admin</BreadcrumbItem>
            <BreadcrumbItem>采集管理</BreadcrumbItem>
        </Breadcrumb>
    </Breadcrumb>
    <ChildContent>
        <Card Style="width: 100%;">
            <GridRow>
                <InputGroup Compact>
                    <SimpleSelect Placeholder="选择视频类型" Style="width: unset;" @bind-Value="@_videoCate">
                        <SelectOptions>
                            @foreach (var cate in cates)
                            {
                                <SimpleSelectOption Value="@cate" Label="@cate"></SimpleSelectOption>
                            }
                        </SelectOptions>
                    </SimpleSelect>
                    <Input @bind-Value="@_url" AllowClear="true" />
                </InputGroup>
            </GridRow>
            <GridRow Style="margin-top: 15px;">
                <Button Type="@ButtonType.Primary" OnClick="AddLink">添加链接</Button>
            </GridRow>
        </Card>

        <Card Style="width: 100%;margin-top: 30px;">
            <GridRow Gutter="16">
                <GridCol Span="8">
                    <Card Style="width:100%;" BodyStyle="padding: 0;">
                        <TitleTemplate>
                            <span>电视剧待采集列表</span>
                        </TitleTemplate>
                        <Extra>
                            <Button Type="@ButtonType.Primary" Disabled="_teleplayStartDisable" OnClick="StartTeleplayCollectAsync">开始</Button>
                        </Extra>
                        <Body>
                            <AntList DataSource="@teleplayAwaitList" Loading="_teleplayListLoading" Style="min-height:200px;">
                                 <ChildContent Context="item">
                                     <ListItem>
                                        <div class="await-list-item-row">
                                            <div class="await-list-item-txt">@item</div>
                                            <Icon Class="await-list-item-remove" Type="close" Style="cursor: pointer;width: 30px;margin: 0 5px;font-size: 12px;" OnClick="@(()=>RemoveTeleplayLink(@item))" />
                                         </div>
                                     </ListItem>
                                 </ChildContent>
                             </AntList>
                         </Body>
                     </Card>
                 </GridCol>

                 <GridCol Span="8">
                    <Card Style="width:100%;" BodyStyle="padding: 0;">
                        <TitleTemplate>
                            <span>电影待采集列表</span>
                        </TitleTemplate>
                        <Extra>
                            <Button Type="@ButtonType.Primary" Disabled="_movieStartDisable" OnClick="StartMovieCollectAsync">开始</Button>
                        </Extra>
                        <Body>
                            <AntList DataSource="@movieAwaitList" Loading="_movieListLoading" Style="min-height:200px;">
                                <ChildContent Context="item">
                                    <ListItem>
                                        <div class="await-list-item-row">
                                            <div class="await-list-item-txt">@item</div>
                                            <Icon Class="await-list-item-remove" Type="close" Style="cursor: pointer;width: 30px;margin: 0 5px;font-size: 12px;" OnClick="@(()=>RemoveMovieLink(@item))" />
                                        </div>
                                    </ListItem>
                                </ChildContent>
                            </AntList>
                        </Body>
                    </Card>
                 </GridCol>

                 <GridCol Span="8">
                    <Card Style="width:100%;" BodyStyle="padding: 0;">
                        <TitleTemplate>
                            <span>动漫待采集列表</span>
                        </TitleTemplate>
                        <Extra>
                            <Button Type="@ButtonType.Primary" Disabled="_animationStartDisable" OnClick="StartAnimationCollect">开始</Button>
                        </Extra>
                        <Body>
                            <AntList DataSource="@animationAwaitList" Loading="_animationListLoading" Style="min-height:200px;">
                                <ChildContent Context="item">
                                    <ListItem>
                                        <div class="await-list-item-row">
                                            <div class="await-list-item-txt">@item</div>
                                            <Icon Class="await-list-item-remove" Type="close" Style="cursor: pointer;width: 30px;margin: 0 5px;font-size: 12px;" OnClick="@(()=>RemoveAnimationLink(@item))" />
                                        </div>
                                    </ListItem>
                                </ChildContent>
                            </AntList>
                        </Body>
                    </Card>
                 </GridCol>
             </GridRow>
        </Card>
     </ChildContent>
 </PageContainer>
